<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ListPlan</title>
<link rel="stylesheet" type="text/css" href="../css/blueprint/screen.css" media="screen, projection"/>
<link rel="stylesheet" type="text/css" href="../css/blueprint/plugins/buttons/screen.css" media="screen, projection"/>
<script type="text/javascript" src="../script/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="../script/jquery.plugin.tablecross-0.1.js"></script>
<script type="text/javascript" src="../script/jquery.plugin.ajaxtip-0.1.js"></script>
<script type="text/javascript">
    var queryVO = {};
    var planId;
    $(document).ready(function() {
        $("#planDataTable").ajaxProccessTip();
        getPlanData(queryVO, 1, 10);
        $(".submit-button").live("click", function() {
            planId = $(this).attr("planid");
            $.ajax({
                url: "SubmitPlanResult.action",
                type: "post",
                data: {"planId": planId},
                dataType: "json",
                success: function(data) {
                	if (data.returnCode == "success") {
                        alert('提交评审意见成功');
                        getPlanData(queryVO, $("#page_index").val(), $("#page_size").val());
                    } else {
                        alert('提交评审意见失败');
                    }
                }
            });
        });
    });

    function getPlanData(queryVO, pageIndex, pageSize) {
        $.getJSON("ListOwnJudgingPlan.action", {"pageIndex": pageIndex, "pageSize": pageSize},
            function(data) {
                if (data.planList != null) {
                    var strArr = new Array();
                    for (var i = 0; i < data.planList.length; i++) {
                        strArr.push('<tr>');
                        strArr.push('<td>' + data.planList[i].registerid + '</td>');//项目登记号
                        strArr.push('<td>' + data.planList[i].prjUnit + '</td>');//项目单位
                        strArr.push('<td>' + data.planList[i].prjName + '</td>');//项目名称
                        strArr.push('<td>' + data.planList[i].prjXmxzName + '</td>');//项目性质
                        strArr.push('<td>' + data.planList[i].prjXmgm + '</td>');//项目规模
                        strArr.push('<td>' + data.planList[i].prjKzName + '</td>');//矿种
                        strArr.push('<td>' + data.planList[i].prjScztName + '</td>');//审查状态 
                        strArr.push('<td>' + '<a href="ExpertJudgePlanDetailPre.action?planId=' + data.planList[i].prjPkid + '" target="MainFrame" class="button">明细</a> ');
                        strArr.push('<a href="OwnJudgingPlanResultPre.action?planId=' + data.planList[i].prjPkid + '" target="MainFrame" class="button">评审</a>');
                        strArr.push('<button class="submit-button" type="button" planid="' + data.planList[i].prjPkid + '">提交评审意见</button></td>');
                        strArr.push('</tr>');
                    }
                    $("#planDataBody").html(strArr.join(''));
                    $("#planDataBody").tablecross('', 'odd', 'over');
                }
            }
        );
    }
</script>
<style type="text/css">
tr.odd td {
    background: #ecf6fc;
}

tr.over td {
    background: #bcd4ec;
}
</style>
</head>
<body>
<div style="margin-top: 0px; padding-left: 10px; margin-bottom: 10px">
    <select>
        <option value="XMDW">项目单位</option>
        <option value="XMXZ">项目性质</option>
        <option value="KZ">矿种</option>
    </select>
    <input type="text" value="" /><input type="button" value="查询" />
</div>
<table id="planDataTable" class="tablesorter" style="margin-top: 0px" width="98%" align="center" cellpadding="2" cellspacing="2">
    <thead>
        <tr>
            <th width="10%">项目登记号</th>
            <th width="12%">项目单位</th>
            <th width="12%">项目名称</th>
            <th width="10%">项目性质</th>
            <th width="10%">项目规模</th>
            <th width="8%">矿种</th>
            <th width="10%">审查状态</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody id="planDataBody">
    </tbody>
</table>
</body>
</html>